using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Text;
using System.Data.SqlClient;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.ApplicationPages;
using Microsoft.SharePoint.Administration;

namespace TweakSP.Web.Admin
{
    public partial class TweakSP_Extremes : GlobalAdminPageBase
    {
        protected WebApplicationSelector selector;
        protected Label feedback;

        private SPWebApplication SelectedWebApp
        {
            get
            {
                return this.selector.CurrentItem;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (ContentService.TweakSP_ContentService.Local.DatabaseTweaksEnabled == false)
            {
                base.RedirectToErrorPage("Database Functionality has not been enabled.  Please visit the TweakSP Admin Settings page to enable Database Functionality.");
            }

        }



        protected void OnSelectorContextChange(object objSender, EventArgs evtargs)
        {
            if (SelectedWebApp != null)
            {
                feedback.Text = "Selected Web App: " + SelectedWebApp.GetResponseUri(SPUrlZone.Default).AbsoluteUri.ToString();
            }
        }

    }
}
